# NOTE: Must import *, since Django looks for things here, e.g. handler500.
from django.conf.urls.defaults import *
from .forms import TripSpotForm
from .models import TripSpot

urlpatterns = patterns('')

urlpatterns += patterns( 'tripsignup.views',
    url(r'^$', 'trips_select'),
    url(r'^signup/(?P<tripids>[\w,]+)/$', 'trips_signup'),
    url(r'^signup/discount/(?P<tripids>[\w,]+)/$', 'trips_signup', {'has_discount': True}),
    url(r'^payment/thanks/$', 'payment_thanks'),

    url(r'^admin/trip/list/$', 'admin_trip_list', name='admin_trip_list'),
    url(r'^admin/trip/add/$', 'admin_trip_add_update', name='admin_trip_add'),
    url(r'^admin/trip/update/(?P<trip_id>\d+)/$', 'admin_trip_add_update', name='admin_trip_update'),
    url(r'^admin/tripspot/list/$', 'admin_tripspot_list', name='admin_tripspot_list_empty'),
    url(r'^admin/tripspot/list/(?P<year>\w+)/(?P<trip_number>\d+)/$', 'admin_tripspot_list', name='admin_tripspot_list'),
    
    url(r'^admin/triproster/download/(?P<year>\w+)/(?P<trip_number>\d+)/$', 'admin_trip_roster_download', name='admin_trip_roster_download'),

    url(r'^admin/$', 'admin_direct_to_template', {'template': 'tripsignup/admin.html'}, name='admin'),
    url(r'^admin/tripspot/update/(?P<tripspot_id>\d+)/$', 'admin_tripspot_update', name='admin_tripspot_update',),
    url(r'^admin/tripspot/(?P<object_id>\d+)/$', 'admin_generic_object_view', {'object_class': TripSpot, 'template': 'tripsignup/admin_tripspot_view.html'}, name='admin_tripspot_view'),

    url(r'^admin/triporder/update/(?P<triporder_id>\d+)/$', 'admin_triporder_update', name='admin_triporder_update',),
)
